using System.Collections;
using System.Collections.Generic;
using QFramework;
using UnityEngine;


namespace AsterroidX
{
    public class GeneratePowerUpSystem : AbstractSystem
    {

       
        protected override void OnInit()
        {
            
        }

        

       

        public void GeneratePowerUpByName(string powerUpName, Transform transform)
        {
            var powerUp = GameObject.Find("Game").transform.Find(powerUpName).GetComponent<PowerUp>();
            GeneratePowerUp(powerUp,transform);
        }

        public void GeneratePowerUp(PowerUp powerUp,Transform transform)
        { 
            powerUp
            .Instantiate()
               .Position(transform.Position()).Show();
        }
        public void RandomGeneratePowerUp(Transform transform)
        {

            var powerUpUnlockSystem = this.GetSystem<PowerUpUnlockSystem>();

            var powerUpName=powerUpUnlockSystem.UnlockedPowerUps.GetRandomItem();
           var powerUp= GameObject.Find("Game").transform.Find(powerUpName).GetComponent<PowerUp>();

            GeneratePowerUp(powerUp, transform);
        }
    }
}
